package com.seele.tigerwallet.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.seele.tigerwallet.ui.utils.BaseUtil;
import java.io.Serializable;



@DatabaseTable(tableName = "t_record")
public class TsRecord implements Serializable {

    /**
     tsfromaddr	发款账户
     tstoaddr	收款账户
     tsnum	交易号
     tsblocknum	区块号
     gas	Gas
     gasprice		Gas价格
     minerfee		矿工费
     value		交易数量
     amounttransfer		交易总量
     note		备注
     tsstatus   交易状态
     tstime		交易时间
     tsacknum	string	交易确认数
     */

    // 交易币ID
    @DatabaseField(columnName = "symbolid")
    public int symbolid;

    // 交易币ID
    @DatabaseField(columnName = "symbol")
    public String symbol;

    @DatabaseField(columnName = "tsfromaddr")
    public String tsfromaddr;

    @DatabaseField(columnName = "tstoaddr")
    public String tstoaddr;

    @DatabaseField(columnName = "tshash")
    public String tshash;

    @DatabaseField(columnName = "tsblocknum")
    public int tsblocknum;

    @DatabaseField(columnName = "gas")
    public String gas;

    @DatabaseField(columnName = "gasprice")
    public String gasprice;

    @DatabaseField(columnName = "minerfee")
    public String minerfee;

    @DatabaseField(columnName = "value")
    public String value;

    @DatabaseField(columnName = "amounttransfer")
    public String amounttransfer;

    //需要Base64 机密
    @DatabaseField(columnName = "note")
    public String note;

    @DatabaseField(columnName = "tstime")
    public String tstime;

    @DatabaseField(columnName = "tsacknum")
    public String tsacknum;

    @DatabaseField(columnName = "tsstatus")
    public int tsstatus;

    @DatabaseField(id = true, canBeNull = false, columnName = "tsid")
    public int tsid;

    public String getNote() {

        return  BaseUtil.getFromBase64(note);
    }

    public void setNote(String note) {
        this.note = note;
    }
}
